<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 <%@ page  import="util.*,cn.news.dao.*,cn.news.entity.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
	function check(){
		var tname = document.getElementById("tname");

		if(tname.value == ""){
			alert("请输入主题名称！！");
			tname.focus();
			return false;
		}		
		return true;
	}
</script>
<%
	String tname = request.getParameter("tname");
	
%>
<div id="main">

  <div id="opt_area">
    <h1 id="opt_type"> 修改主题： </h1>
    <form action="TopicUpdate" method="post" onsubmit="return check()">
      <p>
        <label> 主题名称 </label>
 
      <p>
     
        <%
        List<Topic> cates = (List<Topic>)request.getAttribute("cates");
        int tid = (Integer)request.getAttribute("tid");
	      		for(Topic c:cates)
	      		{
	      		if(c.getTid()==tid){
	      		%> <input type="text" name="tname" value="<%=c.getTname() %>" />
	      		<input type="hidden" name="tid" value="<%=c.getTid() %>"readonly="readonly"/><% 
	      		}
	      }
         %>
      
    
      </p>
      </p>
    
      <input type="submit" value="提交" class="opt_sub" />
      <input type="reset" value="重置" class="opt_sub" />
    </form>
  </div>
</div>

